package behavior.mediator;

public class TV extends Colleague {


    public TV(Mediator mediator, String name) {
        super(mediator, name);
        mediator.register(name,this);
    }

    void sendTVMessage(int status){
        sendMessage(status);
    }

    void on(){
        System.out.println("TV 开机");
    }
    void off(){
        System.out.println("TV 关机");
    }

    @Override
    void sendMessage(int status) {
        this.mediator.getMessage(status,this.name);
    }
}
